from fastapi import FastAPI
import uvicorn
from fastapi.middleware.cors import CORSMiddleware

from src.lai.lai_api import router as lai_router
from src.label.label_api import router as label_router

app = FastAPI(title="local", description="各种工具")

# 配置CORS
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# 注册路由
app.include_router(lai_router, prefix="/lai", tags=["Lai"])
app.include_router(label_router, prefix="/label", tags=["Label"])

# 项目入口
if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=12345)
